All Questions
43 questions
0votes
1answer
310views
Auto-translation of newline characters in the terminal
I'm following along here. I notice (this is not complete, just for demonstration) that at this point: #include <termios.h> raw.c_iflag &= ~(ICRNL | IXON); raw.c_oflag &= ~(OPOST); ...
0votes
2answers
120views
Unix command to cut between strings
my file: Informatica(r) PMCMD, version [10.2.0 HotFix2], build [1911.0401], Workflow run status: [Failed] Output I need is Failed Output I am getting is 10.2.0 HotFix2 Command used: grep "...
1vote
1answer
1kviews
Compare two files and get the matching rows based on two columns
I have two pipe delimited file like below file1.txt A1234|JESSIE|OPTED A1224|JOHN|OPTED L1212|RAMSAY|OPTED L1832|TIZEN|TESTED file2.txt A1234|B1465 G1211|L1211 G1241|L1212 G1271|L1232 Desired output ...
-1votes
3answers
338views
Replace specific characters inside quotes
I'm trying to mask some sensitive data in a log file. I first need to filter out specific lines from the file with a matching pattern and then for those specific lines I need to replace any text ...
-2votes
2answers
764views
Using sed, awk, or tr to split each row, using colon (:) as the separator, into CSV format
I have a massive file of customer account information that is currently sorted like this, into one column. I am looking to split each row, using the : as the separator. But in doing so, for each row, ...
0votes
7answers
760views
Struggling with GREP commands, removing decimal point correctly
I've written the shell command below to output the CPU's clock speed as an integer: grep -m 1 'cpu MHz' /proc/cpuinfo | grep -o -E '[0-9]+' OUTPUT: 900 063 This is because the exact clock speed is ...
-2votes
2answers
66views
How to replace space by __
I have a file containing space for example like this: ACTTTTTTTTGSGSGSGSG TTT RTATATTATRSSTSTSTST HHH I want to eliminate the space and get the result: ACTTTTTTTTGSGSGSGSG__TTT ...
0votes
2answers
69views
How to find 2 or more values in the same line from multiple registers
I have a file with 128420 registers. However I need to find 2 values that are match in one or two or N lines. I need to find values like 59708 and 27073 into the same line Here is a example. I have ...
1vote
3answers
92views
Add space before position in file
I have a strings in file: 7017556626 TEST BSAB 20191108 TEST123 3333 1111 BSAB 11 7007760674 TESTCHAS 20191108 TEST123 4444 5555 CHAS 22 7017556626 TEST 20191108 TEST123 3333 1111 CHAS 33 ...
0votes
1answer
4kviews
Count number of rows with certain columns equal to specific value
I want to counts number of rows with certain columns equal to specific value. Below is a section of the input file: The first row is the header. I want to count the number of rows that column 1 equal ...
1vote
3answers
331views
uniq cluster name
We have several clustered servers and need to check 1 server in each cluster. How do I compare entries in a list to return only one server in each cluster? All server names follow [a-z]-[a-z]-[a-z][0-...
0votes
1answer
7kviews
How can I remove patterns using sed command in a file?
I have a document and I want to remove all the patterns so that I stay with only some information, the producer/creator of that document. I managed to replace patterns with one word "PATTERN" so that ...
0votes
2answers
76views
Extracting some texts from txt file and adding to an existing file bash
all experts I have two types of files in the same directory ex1) record1.txt (record2, record3, record4 ...) 11111 absda qwedc 11112 uiyds dqeds 11113 eqwev jfsec ... ex2) Summary1.txt (Summary2, ...
0votes
2answers
3kviews
Use reverse i search to cycle through only commands matching pattern
The contents of the command history file using history | less is: 555 ls 556 ls -a 557 echo "hello" 558 echo "hello again" 559 cd 560 pwd 561 echo "hello hello" 562 ls 563 echo "hello hello hello" ...
0votes
3answers
2kviews
Use grep to search for words beginning with non-word characters
The contents of the file testing.txt are: ls -a cmake --verbose verbose I want to use grep to look through this file and find only the word beginning with "--" i.e. the word "--verbose" However ...